﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Poke_Tactics.Cenas
{
    class Intro
    {
        GameTime gameTime;
        Texture2D background;
        float scale;
        bool active;
        float totalSeconds;

        Object logo;

        public Intro(GameWindow Window, Texture2D background)
        {
            this.background = background;
            this.scale = 1;
            this.active = true;
            this.gameTime = new GameTime();
            this.totalSeconds = 0;

            logo = new Object(background, Window, 245, 222, 1, 1, false, false);
            logo.Alfa = 0.0f;
            logo.Posicao = new Vector2(300, 0);
            
        }

        public void Update(GameTime gameTime)
        {

                

                if (gameTime.TotalGameTime.Milliseconds % 100 == 0)
                {
                    totalSeconds += 0.5f;
                    logo.Alfa += 0.04f;
                }

             
                if (totalSeconds >= 5 || !this.logo.visivel)
                {
                    Game1.cena_atual = Game1.cenas.CENA_MENU;
                }


        }

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {

            /*spriteBatch.Draw(background,
                new Vector2(275f, 100f),
                new Rectangle(0, 0, background.Width, background.Height),
                Color.White,
                0,
                new Vector2(),
                scale,
                SpriteEffects.None,
                0);
             */

            logo.Draw(gameTime, spriteBatch); 
              

            //spriteBatch.Draw(background, new Rectangle(275, 100, background.Width, background.Height), Color.White);

           
        }
    }
}
